<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>write</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.3.1/css/bootstrap.css}">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js" th:href="@{/webjars/jquery/3.0.0/jquery.js}"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js" th:href="@{/webjars/bootstrap/4.3.1/js/bootstrap.js}"></script>
    <link rel="stylesheet" href="/editor/css/editormd.css" th:href="@{/editor/css/editormd.css}">
    <script src="/jquery.min.js" th:src="@{/editor/jquery.min.js}"></script>
    <script src="/editor/editormd.min.js" th:src="@{/editor/editormd.min.js}"></script>

    <script type="text/javascript">
        var testEditor;

        $(function () {
            // 绑定的是下面DIV的ID
            testEditor = editormd("test-editormd", {
                width: "90%",
                height: 740,
                path: '/editor/lib/',
                // theme: "dark",  // 主题  默认白色
                // previewTheme: "dark",
                // editorTheme: "pastel-on-dark",
                markdown: "",
                codeFold: true,
                saveHTMLToTextarea: true,    // 保存 HTML 到 Textarea
                searchReplace: true,
                //watch : false,                // 关闭实时预览
                htmlDecode: "style,script,iframe|on*",            // 开启 HTML 标签解析，为了安全性，默认不开启
                //toolbar  : false,             //关闭工具栏
                //previewCodeHighlight : false, // 关闭预览 HTML 的代码块高亮，默认开启
                emoji: true,
                taskList: true,
                tocm: true,         // Using [TOCM]
                tex: true,                   // 开启科学公式TeX语言支持，默认关闭
                flowChart: true,             // 开启流程图支持，默认关闭
                sequenceDiagram: true,       // 开启时序/序列图支持，默认关闭,
                //dialogLockScreen : false,   // 设置弹出层对话框不锁屏，全局通用，默认为true
                //dialogShowMask : false,     // 设置弹出层对话框显示透明遮罩层，全局通用，默认为true
                //dialogDraggable : false,    // 设置弹出层对话框不可拖动，全局通用，默认为true
                //dialogMaskOpacity : 0.4,    // 设置透明遮罩层的透明度，全局通用，默认值为0.1
                //dialogMaskBgColor : "#000", // 设置透明遮罩层的背景颜色，全局通用，默认为#fff
                imageUpload: true,
                imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                imageUploadURL: "/uploadfile",

                onload: function () {
                    // this.fullscreen();
                    // this.unwatch();
                    // this.watch().fullscreen();
                    //
                    // this.setMarkdown("#PHP");
                    // this.width("100%");
                    // this.height(480);
                    // this.resize("100%", 640);
                }
            });
        });
    </script>
</head>
<body   background="/statics/images/penghua.jpg">
<a class="button btn-sm btn-success" th:href="@{/main}">返回首页</a>
<form role="form" th:action="@{/main/submit}" method="post">
    <div class="form-group">
        <input type="hidden" name="id" >
        <input type="hidden" name="preeditorId" >
        <input type="hidden" name="nexteditorId" >
        <label  class="text-center">标题</label>
        <input type="text" name="editorTitle" autocomplete="off" class="form-control" id="name1"
               placeholder="请输入标题" required="">
        <label >作者</label>
        <input type="text" name="editorAuthor" autocomplete="off" class="form-control" placeholder="请输入作者" id="name2" required="">
        <label  class="text-center">摘要</label>
        <input type="text" name="editorTabloid" autocomplete="off" class="form-control" id="name3"
               placeholder="请输入摘要" required="">
        <label  class="text-center">选择日期</label>
        <input type="date" name="editorDate"  required=""/>
    </div>

    <!-- editormd start -->
    <div class="editormd" id="test-editormd">
        <textarea class="editormd-markdown-textarea" name="editormd" id="editormd"></textarea>
        <!-- 第二个隐藏文本域，用来构造生成的HTML代码，方便表单POST提交，这里的name可以任意取，后台接受时以这个name键为准 -->
        <!-- html textarea 需要开启配置项 saveHTMLToTextarea == true -->
        <textarea class="editormd-html-textarea" name="editorhtml" id="editorhtml"></textarea>
    </div>
    <div align="center" style="position:relative;top:10px">
        <button type="submit" class="btn btn-lg btn-primary">提交</button>
    </div>

</form>

</body>
</html>